{% extends "common.html" %}
{% block css %}
<link href="/static/css/reset_menu.css" rel="stylesheet" type="text/css">
<link href="/static/css/style-static.css" rel="stylesheet" type="text/css">
<link href="/static/css/bootstrap.css" rel="stylesheet" type="text/css">
<style type="text/css">
  .blue{
    background:#31d2e7;
    color: white;
  }
</style>
{% load i18n %}
<script src="/static/js/laydate.js"></script>
 <script type="text/javascript" charset="utf-8" src="/static/js/ueditor.config.js"></script>
 <script type="text/javascript" charset="utf-8" src="/static/js/ueditor.all.min.js"> </script>

{% endblock %}
{% block content %}

<!--------内容-------------->
<div class="edititem">
    {% include "side.html" %}

  <div class="enterprise">
    <form method="post" action="{% url "publish" %}">
    
     <h2><span></span>基本信息</h2>
     <div class="form-horizontal text-left">
      <div class="form-group">
        <label  class="col-sm-2 control-label">名称:</label>
        <div class="col-sm-4">
          <input type="text" class="form-control" name="title" value="{{title}}">
        </div>
      </div>

      

      


      <div class="form-group">
      <label class="col-sm-2 control-label">受众:</label>

       <div class="col-sm-2" id="">
       <select class="form-control" name="type">
       
         <option value="1">求职者</option>
         <option value="2">企业</option>
      
        
         
       </select>
       </div>
     

       

      </div>

      <div class="form-group">
        <label  class="col-sm-2 control-label">内容:</label>
        <div class="col-sm-8">
   <!--  <textarea id="description" class="form-control" rows="7"  style="width:100%" name="content" ></textarea> -->
    <script type="text/plain" id="myEditor" style="width:600px;height:500px;">
        <p>{{content}}</p>
</script>
        </div>
      </div>




<script type="text/javascript">
        UE.getEditor('myEditor',{
            //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
            toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold','test']],
            //focus时自动清空初始化时的内容
            autoClearinitialContent:false,
            textarea:'content',
            //关闭字数统计
            wordCount:true,
            //关闭elementPath
            elementPathEnabled:false,
            //默认的编辑区域高度
            initialFrameHeight:300
            //更多其他参数，请参考ueditor.config.js中的配置项
        })
    </script>

    <div class="form-group">
        <label  class="col-sm-2 control-label"></label>
        <div class="col-sm-2">
           <input class="btn btn-default blue col-sm-10"  type="submit" value="提交">

        </div>
      </div>

    </div>
   
    

 
 {% csrf_token %}




</form>
<form id="logoForm" action="{% url "upload" %}" method="post" enctype="multipart/form-data">
   <input style="display:none" type="file" id="logo" name="file" onchange="uploadImage('logo')">
 
 {% csrf_token %}
</form>
</div>

</div>              
<script src="/static/js/jquery.form.min.js"></script>
<script type="text/javascript">
  var back = ''
    function uploadImage(obj) { 
          back = obj
          var option = {
          url : '{% url "upload" %}',
          success:showResponse,
        }

        $('#'+back+'Form').ajaxSubmit(
           option
        ); 
    }; 
   
    function showResponse(responseText){
      console.log(responseText.name)
      $('#return'+back).attr('src','/static/upload/' + responseText.name)
      $('[name=cover]').val(responseText.name)
    }
</script>

{% endblock %}  
